#include <vector>

using namespace std;

class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int place_i = 0;
        for (int i = 0; i < nums.size(); i++) {
            if (nums[i] != 0) {
                if (i != place_i) {
                    nums[place_i] = nums[i];
                }
                place_i++;
            }
        }
        while (place_i < nums.size()) {
            nums[place_i] = 0;
            place_i++;
        }
    }
};